Extension { #name : 'Context' }

{ #category : '*Fuel-Core-Tests' }
Context >> assertWellMaterializedInto: aMethodContext in: aTestCase [

	aTestCase assert: self ~~ aMethodContext.
	aTestCase assert: self class == aMethodContext class.
	aTestCase assert: self temporaryVariableNames = aMethodContext temporaryVariableNames.
	aTestCase assert: pc = aMethodContext pc.
	aTestCase assert: stackp = aMethodContext stackPtr.
	closureOrNil
		ifNil: [ aTestCase assert: aMethodContext closure isNil ]
		ifNotNil: [ closureOrNil assertWellMaterializedInto: aMethodContext closure in: aTestCase ].
	aTestCase assert: receiver = aMethodContext receiver.
	aTestCase assert: (method isEqualRegardlessTrailerTo: aMethodContext compiledCode).
	sender
		ifNil: [ aTestCase assert: aMethodContext sender isNil ]
		ifNotNil: [ sender assertWellMaterializedInto: aMethodContext sender in: aTestCase ]
]

{ #category : '*Fuel-Core-Tests' }
Context >> initializeWith: aPc stackPtr: aStackPtr method: aMethod receiver: aReceiver sender: aSender [
	pc := aPc.
	stackp := aStackPtr.
	method := aMethod.
	receiver := aReceiver.
	sender := aSender.
]
